combine  MACRO  destination, sign, exponent, fraction
LOCAL  endZero
; take the separate pieces:
;   sign: byte
;   exponent: word (bias removed)
;   fraction: doubleword (with leading 1)
; of a floating point value and combine them into a 32-bit
; IEEE result at destination
          push eax             ; save EAX
          push ebx             ;   and EBX
          mov  eax, 0          ; zero result
          cmp  fraction, 0     ; zero value?
          je   endZero         ; skip if so
          mov  al, sign        ; get sign
          ror  eax, 1          ; rotate sign into position
          mov  bx, exponent    ; get exponent
          add  bx, 127         ; add bias
          shl  ebx, 23         ; shift to exponent position
          or   eax, ebx        ; combine with sign
          mov  ebx, fraction   ; get fraction
          and  ebx, 7fffffh    ; remove leading 1 bit
          or   eax, ebx        ; combine with sign and exponent
endZero:
          mov  destination, eax ;store result
          pop  ebx             ; restore registers
          pop  eax
          ENDM

